# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RoutingRule do
  @moduledoc """


  ## Attributes

  *   `basepath` (*type:* `String.t`, *default:* `nil`) - URI path prefix used to route to the specified environment. May contain one or more wildcards. For example, path segments consisting of a single `*` character will match any string.
  *   `deploymentGroup` (*type:* `String.t`, *default:* `nil`) - Name of a deployment group in an environment bound to the environment group in the following format: `organizations/{org}/environment/{env}/deploymentGroups/{group}` Only one of environment or deployment_group will be set.
  *   `envGroupRevision` (*type:* `String.t`, *default:* `nil`) - The env group config revision_id when this rule was added or last updated. This value is set when the rule is created and will only update if the the environment_id changes. It is used to determine if the runtime is up to date with respect to this rule. This field is omitted from the IngressConfig unless the GetDeployedIngressConfig API is called with view=FULL.
  *   `environment` (*type:* `String.t`, *default:* `nil`) - Name of an environment bound to the environment group in the following format: `organizations/{org}/environments/{env}`. Only one of environment or deployment_group will be set.
  *   `otherTargets` (*type:* `list(String.t)`, *default:* `nil`) - Conflicting targets, which will be resource names specifying either deployment groups or environments.
  *   `receiver` (*type:* `String.t`, *default:* `nil`) - The resource name of the proxy revision that is receiving this basepath in the following format: `organizations/{org}/apis/{api}/revisions/{rev}`. This field is omitted from the IngressConfig unless the GetDeployedIngressConfig API is called with view=FULL.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The unix timestamp when this rule was updated. This is updated whenever env_group_revision is updated. This field is omitted from the IngressConfig unless the GetDeployedIngressConfig API is called with view=FULL.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :basepath => String.t() | nil,
          :deploymentGroup => String.t() | nil,
          :envGroupRevision => String.t() | nil,
          :environment => String.t() | nil,
          :otherTargets => list(String.t()) | nil,
          :receiver => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:basepath)
  field(:deploymentGroup)
  field(:envGroupRevision)
  field(:environment)
  field(:otherTargets, type: :list)
  field(:receiver)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RoutingRule do
  def decode(value, options) do
    GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RoutingRule.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RoutingRule do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
